package org.example.repository;

import org.example.entity.UserAuthenticationDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 用户认证信息Repository
 * </p>
 *
 * @author jinshihui
 */
@Repository
public interface UserAuthenticationRepository extends JpaRepository<UserAuthenticationDO, Integer> {
    boolean existsByUsername(String username);

    boolean existsByEmail(String email);

    @Query("SELECT u FROM UserAuthenticationDO u WHERE u.username = ?1")
    UserAuthenticationDO findByUsername(String username);
}